package cqut;

import sun.text.resources.cldr.ti.FormatData_ti;

import java.util.ArrayList;
import java.util.Scanner;

import static java.lang.System.in;
class test{
    public static void main(String[] args) {
        ArrayList list=new ArrayList();
        Scanner san=new Scanner(in);
        System.out.println("请输入一个以0结束的字符串序列");
        while(san.nextInt()!=0){
            list.add(san.nextInt());}
       li l=new li();
        int ret=l.max(list);
        System.out.println(ret);

    }}
class li{
    public static Integer max(ArrayList<Integer> list){
        if(list==null||list.size()==0){
            return null;
        }
        int max=0;
        for (int i = 0; i < list.size(); i++) {
            if(list.get(i)>max) {
            max=list.get(i);
            }
        }
        return max;
    }


    public static void main6(String[] args) {
        int a=6;
        int count=0;
        while(a!=0){
            a=a&(a-1);
            count++;
        }
        System.out.println(count);
    }
    public static void main5(String[] args) {
        int x=20,y=40;
        while(y!=0) {int a=x%y;
           x=y;
           y=a;
        }
        System.out.println(x);
    }
    public static void main4(String[] args) {
        double sum=0,sum1=0;
        for (int i = 1; i <100; i+=2) {
            sum+=1.0/i;
        }
        for (int i = 2; i<=100 ; i+=2) {
            sum1+=1.0/i;
        }
        double sum2=sum-sum1;
        System.out.println(sum2);
    }
    public static void main3(String[] args) {
        for (int i = 0; i < 1000; i++) {
            int a=i%10;
            int b=i/10%10;
            int d=i/100%10;
            if(i==Math.pow(a,3)+Math.pow(b,3)+Math.pow(d,3))
            {
                System.out.println(i);
            }
        }
    }

    public static void main2(String[] args) {

          int c=7;
        for (int i = 2; i<c; i++) {
            if(c%i==0) {
                System.out.println("不是素数");
                return;
            }
        }
        System.out.println("是素数");
    }
    public static void main1(String[] args) {
        int count=0;
        for (int i = 1; i <101 ; i++) {

            if(i/10==9) {
                count++;}
            if(i%10==9){
                count++;
            }

        }
        System.out.println(count);
    }
}
